<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
  	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>App菜单管理</title>
    <link rel="stylesheet" href="../plugins/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../public/css/app.css" media="all" />
    <link rel="stylesheet" href="../public/css/doc.css" media="all">
    <link rel="stylesheet" href="../public/css/message.css" media="all">
    <link rel="stylesheet" href="../public/css/nprogress.css" media="all">
    <style>
    	.layui-table-body div{
    		_height:200px; 
			min-height:50px;
			line-height:50px;
    	}
    	.layui-table-body .layui-table-cell .layui-form-checkbox .layui-icon {
    		 margin-top:15px 
    	}
    </style>
</head>

<body>
	<div class="kit-doc" style="padding:10px;">
   		<blockquote class="layui-elem-quote layui-text">App菜单管理</blockquote>
    </div>
    <div class="kit-table" style="margin-left:10px;margin-right:10px;">
	    <form class="layui-form" lay-filter="kit-search-form">
	        <div class="kit-table-header">
	            <div class="kit-search-btns">
	                <a href="javascript:;" data-action="add" class="layui-btn layui-btn-small"><i class="layui-icon">&#xe608;</i> 新增</a>
	                <a href="javascript:;" data-action="del-bulk" class="layui-btn layui-btn-small layui-btn-danger"><i class="layui-icon">&#xe640;</i> 批量删除</a>
	            </div>
	            <div class="kit-search-inputs">
	                <div class="kit-search-keyword">
	                    <input type="text" class="layui-input" name="name" placeholder="搜索菜单名.." />
	                    <button lay-submit lay-filter="search"><i class="layui-icon">&#xe615;</i></button>
	                </div>
	            </div>
	        </div>
	    </form>
	    <div class="kit-table-body">
	        <table id="demo" lay-filter="demo"></table>
	        <script type="text/html" id="barDemo">
            	<a class="layui-btn layui-btn-mini" lay-event="edit">编辑</a>
            	<a class="layui-btn layui-btn-danger layui-btn-mini" lay-event="del">删除</a>
        	</script>
	    </div>
	</div>
	
	<script type="text/html" id="enablestpl">
		{{#  if(d.enable == '1'){ }}
  			<span style="color: #90EE90;">可用</span>
		{{#  } else { }}
			<span style="color: #FF6A6A;">禁用</span>
		{{#  } }}
	</script>
	
	<script type="text/html" id="imgtpl">
		{{#  if(d.imgUrl != null&&d.imgUrl != ""){ }}
  			<div class="my-table-height"><img src="{{d.imgUrl}}" width="50" height="50"/></div>
		{{#  } else { }}
			<div class="my-table-height">
		{{#  } }}
	</script>
	
	<script type="text/html" id="edit-tpl">
    	<div style="margin:10px">
        	<div class="layui-form" action="" lay-filter="form-edit">
				<input type="hidden" name="menuIdList" />
				{{# if(d.appmenu.id!=""){}}
					<input type="hidden" id="id" name="id" value="{{d.appmenu.id}}" />
				{{#};}}
				<input type="hidden" id="imgflg"/>
				<div class="layui-form-item">
                	<label class="layui-form-label">排序</label>
                	<div class="layui-input-block">
                    	<input id="code" type="text" name="code" required lay-verify="required" value="{{d.appmenu.code}}" placeholder="排序" autocomplete="off" class="layui-input">
                	</div>
            	</div>
            	<div class="layui-form-item">
                	<label class="layui-form-label">APP菜单名</label>
                	<div class="layui-input-block">
                    	<input id="name" type="text" name="name" required lay-verify="required" value="{{d.appmenu.name}}" placeholder="APP菜单名" autocomplete="off" class="layui-input">
                	</div>
            	</div>
				<div class="layui-form-item">
                	<label class="layui-form-label">菜单Logo</label>
						<div class="layui-upload">
  							<button type="button" class="layui-btn" id="menuLogoButton"><i class="layui-icon">&#xe681;</i>选择图片</button>
						</div> 
            	</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
						<div class="layui-upload-list">
								{{# if(d.appmenu.imgUrl!=null&&d.appmenu.imgUrl!=""){}}
									<img class="layui-upload-img" id="menuLogo" width="115" height="115" src="{{d.appmenu.imgUrl}}">
								{{# }else{}}
									<img class="layui-upload-img" id="menuLogo" width="115" height="115">
								{{# }}}
  						</div>
            	</div>
				<div class="layui-form-item">
    				<label class="layui-form-label">上级菜单</label>
					<div class="layui-input-block">
						<select id="parentId" name="parentId" lay-verify="">
  							<option value="">一级菜单</option>
							{{# var item = d.parentMenu,item1=d.appmenu.parentId;}}
								{{# for(var i=0;i<item.length;i++){}}
									{{# if(item[i].id==item1){}}
										<option value="{{item[i].id}}" selected>{{item[i].name}}</option>
									{{# }else{}}
										<option value="{{item[i].id}}">{{item[i].name}}</option>
									{{# }}}
								{{# }}}
						</select>
					</div>
  				</div>

				<div class="layui-form-item">
                	<label class="layui-form-label">链接</label>
                	<div class="layui-input-block">
						<select id="url" name="url" lay-verify="">
						<option value=""  >无</option>	
							{{# var item = d.types}}
								{{# for(var i=0;i<item.length;i++){}}

									{{# if(d.appmenu.url==item[i].id){}}
										<option value="{{item[i].id}}" selected >{{item[i].businessName}}</option>	
									{{# }else{}}
										<option value="{{item[i].id}}" >{{item[i].businessName}}</option>	
									{{# }}}
								{{# }}}
						</select>
					</div>
            	</div>
				<div class="layui-form-item">
    				<label class="layui-form-label">状态</label>
    				<div class="layui-input-block">
					{{# var normal = d.appmenu.enable === 1?'checked':'checked';}} {{# var forbiden = d.appmenu.enable === 0?'':'';}}
      				<input type="radio" name="enable" value="1" title="可用" lay-filter="radiobu" {{normal}}>
      				<input type="radio" name="enable" value="0" title="禁用" lay-filter="radiobu" {{forbiden}}>
    				</div>
  				</div>
            	<div class="layui-form-item" style="display:none;">
                	<div class="layui-input-block">
                    	<button id="formEdit" class="layui-btn" lay-submit lay-filter="formEdit">立即提交</button>
                    	<button type="reset" class="layui-btn layui-btn-primary">重置</button>
                	</div>
            	</div>
        	</div>
    	</div>
	</script>
    <script src="../plugins/layui/layui.js"></script>
    <script src="./js/appmenu.js"></script>
</body>

</html>